package com.etc.service.impl;


import com.etc.dao.HistoryPersonageDao;
import com.etc.dao.UserPersonageDao;
import com.etc.pojo.History;
import com.etc.pojo.User;
import com.etc.service.HistoryPersonageService;
import com.etc.service.UserPersonageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserPersonageServiceImpl implements UserPersonageService {

    @Autowired
    UserPersonageDao userPersonageDao;

    @Override
    public boolean updateUserImg(User user, String imgPath) {
        int leep = userPersonageDao.updateUserImg(user, imgPath);
        return leep > 0;
    }

    @Override
    public User queryUserByUserId(User user) {
        User users = userPersonageDao.queryUserByUserId(user);
        return users;
    }

    @Override
    public boolean updateUserPassword(User user, String newPasswoed) {
        int leep = userPersonageDao.updateUserPassword(user, newPasswoed);
        return leep>0;
    }

    @Override
    public boolean addUserVip(User user, Integer dataTime) {
        return userPersonageDao.addUserVip(user,dataTime) > 0;
    }

    @Override
    public boolean updateUserVipTime(User user, Integer dataTime) {
        return userPersonageDao.updateUserVipTime(user,dataTime) > 0;
    }

    @Override
    public boolean updateUserVipState(User user) {
        return userPersonageDao.updateUserVipState(user) > 0;
    }


}
